{layout name="p/base"}
  <div id="page-wrapper">
    <div class="row">
      <div class="col-lg-12">
        <h1>房车管理 <small>编辑房车信息</small></h1>
        <ol class="breadcrumb">
          <li><a href="index.php"><i class="fa fa-dashboard"></i> 管理首页</a></li>
          <li><a href="/caravan"><i class="fa fa-dashboard"></i> 房车信息列表</a></li>
          <li class="active"><i class="fa fa-table"></i> 编辑房车信息</li>
        </ol>
        <div class="alert alert-success alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
          请准确编辑房车信息
        </div>
      </div>
    </div>
    <!-- /.row -->
    <div class="row">
      <!-- 选项卡start -->
      <div class="bs-example">
        <!-- 选项卡标题start -->
        <ul class="nav nav-tabs" style="margin-bottom:15px;">
          <li class="active">
            <a href="#one" data-toggle="tab">基本信息</a>
          </li>
        </ul>
        <!-- 选项卡标题end -->
        <!-- 选项卡内容start -->
        <div id="myTabContent" class="tab-content">
          <!-- 选项卡内容1start -->
          <div id="one" class="tab-pane fade active in">
            <form class="form-horizontal" role="form" action="/cartpl/{$id}" method="post">
            <input type="hidden" id='method' name="_method" value="PUT">
              <!-- 基本信息start -->
              <div class="col-lg-6">
                <div class="panel panel-default">
                  <div class="panel-heading ">
                    <h3 class="panel-title">
                      基本信息
                    </h3>
                  </div>
                  <div class="panel-body">
                    <div class="form-group">
                      <label for="firstname" class="col-sm-3 control-label">车系名称</label>
                      <div class="col-sm-9">
                         <input type="text" class="form-control" name="cartpl_name" id="firstname" value="{$cartpl_info.cartpl_name}" 
                            placeholder="请正确填写车系名称">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-3 control-label">车系描述</label>
                      <div class="col-sm-9">
                         <input type="text" class="form-control" name="describe" id="firstname" value="{$cartpl_info.describe}" 
                            placeholder="请填写车系描述">
                      </div>
                    </div>

                    <div class="form-group ">
                      <label for="firstname" class="control-label col-sm-3">车辆品牌</label>
                      <div class="col-sm-9">
                      <select class="form-control" name="brand_id">
                      {volist name='brand' id='vo'}
                      {if $cartpl_info.brand_id==$vo.id}
                        <option value={$vo.id} selected='true'>{$vo.name}</option>
                      {else} 
                        <option value={$vo.id} >{$vo.name}</option>
                      {/if}
                      {/volist}
                      </select>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="control-label col-sm-3">车型</label>
                      <div class="col-sm-9">
                      <select class="form-control" name="carcate_id">
                       {foreach $carcates as $k => $type}
                       {if $cartpl_info.carcate_id==$k}
                       <option value={$k} selected='true'>{$type}</option>
                       {else}
                       <option value={$k} >{$type}</option>
                       {/if}
                       {/foreach}
                      </select>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="control-label col-sm-3">等级</label>
                      <div class="col-sm-9">
                      <select class="form-control" name="grade">
                       {if $cartpl_info.grade == '1'}
                       <option selected='true' value="1">标准型</option>
                       <option value="2">豪华型</option>
                       <option value="3">尊贵型</option>
                       {elseif $cartpl_info.grade == '2'}
                       <option selected='true' value="2">豪华型</option>
                       <option value="1">标准型</option>
                       <option value="3">尊贵型</option>
                       {else}
                       <option selected='true' value="1">尊贵型</option>
                       <option value="1">标准型</option>
                       <option value="2">豪华型</option>
                       {/if}
                      </select>
                      </div>
                    </div>

                    <div class="form-group">
                      <label for="firstname" class="col-sm-3 control-label">泊位编号</label>
                      <div class="col-sm-9">
                         <input type="text" class="form-control" name="park" id="firstname" value="{$cartpl_info.park}" 
                            placeholder="请填写泊位编号">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-3 control-label">注册日期</label>
                      <div class="col-sm-9">
                         <input type="text" class="form-control" name="register_date" id="firstname" value="{$cartpl_info.register_date}" 
                            placeholder="例，2014-10-12">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-3 control-label">车牌号</label>
                      <div class="col-sm-9">
                         <input type="text" class="form-control" name="plate_num" id="firstname" value="{$cartpl_info.plate_num}" 
                            placeholder="例，2014-10-12">
                      </div>
                    </div>

                    <div class="form-group">
                      <label for="firstname" class="control-label col-sm-3">国别</label>
                        <div class="col-sm-9">
                          <select class="form-control" name="carcountry_id">
                           {foreach $country as $k => $type}
                           {if $cartpl_info.carcountry_id =$k}
                           <option value={$k} selected='true'>{$type}</option>
                           {else}
                           <option value={$k} >{$type}</option>
                           {/if}
                           {/foreach}
                          </select>
                        </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="control-label col-sm-3">排挡</label>
                      <div class="col-sm-9">
                      <select class="form-control" name="gear">
                       {if $cartpl_info.gear == 1}
                       <option selected='true' value="1">自动挡</option>
                       <option value="3">无</option>
                       <option value="2">手动挡</option>
                       {elseif $cartpl_info.gear == 2}
                       <option selected='true' value="2">手动挡</option>
                       <option value="3">无</option>
                       <option value="1">自动挡</option>
                       {else}
                       <option selected='true' value="3">无</option>
                       <option value="1">自动挡</option>
                       <option value="2">手动挡</option>
                       {/if}
                      </select>
                      </div>
                    </div>
                    <div class="form-group ">
                      <label class="control-label col-sm-3">准驾类型</label>
                        <div class="col-sm-9">
                          <select class="form-control" name="drivetype_id">
                           {foreach $drive_type as $k => $v}
                           {if $cartpl_info.drivetype_id==$k}
                           <option value={$k} selected='true'>{$v}</option>
                           {else}
                           <option value={$k} >{$v}</option>
                           {/if}
                           {/foreach}
                          </select>
                        </div>
                    </div>



                  </div>
                </div>
              </div>
              <!-- 基本信息end -->
              <!-- 车内配套设施start -->
              <div class="col-lg-6">
                <div class="panel panel-default">
                  <div class="panel-heading">
                    <h3 class="panel-title">
                      车内配套设施
                    </h3>
                  </div>
                  <div class="panel-body">
                    <div class="form-group">
                      <label for="firstname" class="col-sm-4 control-label">长*宽*高(mm)</label>
                      <div class="col-sm-8">
                         <input type="text" class="form-control" name="size" id="firstname" value="{$cartpl_info.size}" 
                            placeholder="例，5999*2420*3034">
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-4 control-label">单人床数量(张)</label>
                      <div class="col-sm-2">
                         <input type="text" class="form-control" name="single_bed_num" id="firstname" value="{$cartpl_info.single_bed_num}" 
                            placeholder="8"></input>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-4 control-label">双人床数量(张)</label>
                      <div class="col-sm-2">
                         <input type="text" class="form-control" name="double_bed_num" id="firstname" value="{$cartpl_info.double_bed_num}" 
                            placeholder="8"></input>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-4 control-label">可住几人</label>
                      <div class="col-sm-8">
                         <input type="text" class="form-control"  name="people_num" id="firstname" value="{$cartpl_info.people_num}" 
                            placeholder="请直接填写阿拉伯数字"></input>
                      </div>
                    </div>
                    <div class="form-group">
                      <label for="firstname" class="col-sm-4 control-label">沙发乘坐人数</label>
                      <div class="col-sm-8">
                         <input type="text" class="form-control"  name="sofe_num" id="firstname" value="{$cartpl_info.sofe_num}" 
                            placeholder="请直接填写阿拉伯数字"></input>
                      </div>
                    </div>
                    

                    {foreach $ziduans as $key=>$value}
                    <div class="form-group ">
                      <label for="firstname" class="control-label col-sm-4">{$key|lang}</label>
                      {foreach $value as $k=>$v}
                      <label class="radio-inline">
                      {if $cartpl_info->$key==$k}
                      <input id="{$key.$k}" name="{$key}" checked="true" value="{$k}"  type="radio">{$v|lang}
                      {else}
                      <input id="{$key.$k}" name="{$key}" value="{$k}"  type="radio">{$v|lang}
                      {/if}
                      </label>
                      {/foreach}
                     </div>
                  {/foreach}

                  </div>
                </div>
              </div>
              <!-- 车内配套设施end -->
              
              <div class="col-lg-6 col-lg-offset-6">
                <input type="button" value="返回" class="btn btn-default"  onclick="javascript:history.back(-1);" />
                <button class="btn btn-primary" type="submit">提交</button>
              </div>
            </form>
          </div>
          <!-- 选项卡内容1end -->
        </div>
        <!-- 选项卡内容end -->
      </div>
      <!-- 选项卡end -->
    </div>

  </div><!-- /#page-wrapper -->

